<template>
  <BasicModal v-bind="$attrs" @register="registerModal"  :footer="null" title="详情" width="60%" destroyOnClose>
    <Description :column="1" :data="dataInfo" :schema="formSchema" />
  </BasicModal>
</template>
<script lang="ts" setup>
import { ref, useAttrs } from 'vue';
import { formSchema } from '../InputsTemplate.data';
import { Description, useDescription } from '/@/components/Description/index';
import BasicModal from "/@/components/Modal/src/BasicModal.vue";
import {useModalInner} from "/@/components/Modal";
const emit = defineEmits(['register']);
const attrs = useAttrs();
const dataInfo = ref({});
const  formSchema =  [
  {
    label: '模板名称',
    field: 'templateName',
  },
  {
    label: '投入品名称',
    field: 'name',
  },
  {
    label: '投入品编号',
    field: 'no',
  },
  {
    label: '俗称',
    field: 'popularName',
  },
  {
    label: '投入品种类',
    field: 'input_dictText',
  },
  {
    label: '特征描述',
    field: 'feature',
  },
  {
    label: '生产厂家',
    field: 'manufacturer',
  },
  {
    label: '出厂日期',
    field: 'productionDate',
  },
  {
    label: '保质期',
    field: 'qualityPeriod',
  },
  {
    label: '库存量(kg)',
    field: 'stock',
  },
  {
    label: '最低库存量(kg)',
    field: 'stockLowest',
  },
  {
    label: '最高库存量(kg)',
    field: 'stockHighest',
  },
]
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
  setModalProps({ confirmLoading: false });
  console.log(data);
  dataInfo.value = data.record;
  console.log(dataInfo.value);
});
</script>
